//
// Created by Gorun on 2022/5/6.
//

#ifndef LOXPP_LOXINSTANCE_H
#define LOXPP_LOXINSTANCE_H

#include <any>
#include <map>
#include <memory>
#include <string>

class LoxClass;
class Token;

using namespace std;

class LoxInstance: public enable_shared_from_this<LoxInstance> {
private:
    shared_ptr<LoxClass> klass;
    map<string, any> fields;

public:
    LoxInstance(shared_ptr<LoxClass> klass);
    string toString();
    any get(const Token& name);
    void set(const Token& name, any value);
};


#endif //LOXPP_LOXINSTANCE_H
